package com.qdxwx.models.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 购买内容表
 * @author MrGao
 * @createTime 2021/4/12
 * @description
 */
public class UserBuy implements Serializable {

    private static final long serialVersionUID = 3605883906974340888L;

    /**
     * 主键id
     */
    private long id;
    /**
     *
     */
    private int moduleId;
    /**
     * 内容id
     */
    private long infoId;
    /**
     * 标题
     */
    private String title;
    /*
     * 价格
     */
    private int price;
    /**
     * userId
     */
    private long userId;
    /**
     * userName
     */
    private String userName;
    /**
     * 失效日期
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate expireDate;
    /** 创建时间 */
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public UserBuy() {
    }

    public UserBuy(long userId, int moduleId, long infoId) {
        this.moduleId = moduleId;
        this.userId = userId;
        this.infoId = infoId;
    }


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public int getModuleId() {
        return moduleId;
    }

    public void setModuleId(int moduleId) {
        this.moduleId = moduleId;
    }

    public long getInfoId() {
        return infoId;
    }

    public void setInfoId(long infoId) {
        this.infoId = infoId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public LocalDate getExpireDate() {
        return expireDate;
    }

    public void setExpireDate(LocalDate expireDate) {
        this.expireDate = expireDate;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "UserBuy{" +
                "id=" + id +
                ", moduleId=" + moduleId +
                ", courseId=" + infoId +
                ", courseName='" + title + '\'' +
                ", price=" + price +
                ", userId=" + userId +
                ", userName='" + userName + '\'' +
                ", expireDate=" + expireDate +
                ", createTime=" + createTime +
                '}';
    }
}
